package com.spring_mysql_redis;

import com.spring_mysql_redis.webSocket.WebSocketServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@MapperScan("com.spring_mysql_redis.mapper")
public class SpringbootMysqlRedisApplication {

    public static void main(String[] args) {
//        SpringApplication.run(SpringbootMysqlRedisApplication.class, args);
        SpringApplication springApplication = new SpringApplication(SpringbootMysqlRedisApplication.class);
        springApplication.addListeners(new ApplicationPidFileWriter());
        ConfigurableApplicationContext applicationContext = springApplication.run(args);
        WebSocketServer.setApplicationContext(applicationContext);
    }

}
